﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TVShow.Framework
{
  public partial class MenuItem : UserControl
  {
    public override string Text
    {
      get
      {
        return base.Text;
      }
      set
      {
        base.Text = value;
      }
    }

		public int Index { get; set; }
		public string MessageData { get; set; }

		public MenuItem()
    {
      InitializeComponent();
    }

    private void MenuItem_Paint(object sender, PaintEventArgs e)
    {
      Graphics g = e.Graphics;
      //g.Clear(BackColor);
      int height = ClientRectangle.Height - 2;
      if (height < 5) height = 5;
      Font font = new Font("Arial", height, GraphicsUnit.Pixel);

      Brush b = new SolidBrush(ForeColor);
      g.DrawString(this.Text, font, b, new Point(0, 0));
    }

    private void MenuItem_MouseEnter(object sender, EventArgs e)
    {
      //Focus();
    }

    private void MenuItem_MouseLeave(object sender, EventArgs e)
    {
      //BackColor = Color.Transparent;
    }

		private void MenuItem_Enter(object sender, EventArgs e) {
			BackColor = Color.LightBlue;
		}

		private void MenuItem_Leave(object sender, EventArgs e) {
			BackColor = Color.Transparent;
		}

		protected override bool IsInputKey(Keys keyData) {
			return true;
		}
  }
}
